from . import http

def get_org_user(base_url):
    r = http.get(base_url%('common/biz-org'))
    orgs = r.json()['model']
    m = {}
    for org in orgs:
        if org.get('allowTake',False) and org.get('allowSend',False):
            r = http.get(base_url%('common/user'),dict(orgId=org['id']))
            u = r.json()['model']
            if len(u):
                m[org['id']] = u[0]['id']
    return m
